package com.qf.Service.impl;

import com.qf.Dao.impl.SysRoleDaoImpl;
import com.qf.Service.SysRoleService;
import com.qf.entity.SysRole;
import com.qf.entity.SysUserRoleDept;

import java.sql.SQLException;

public class SysRoleServiceImpl implements SysRoleService {
    SysRoleDaoImpl sysRoleDao = new SysRoleDaoImpl();

    @Override
    public SysUserRoleDept selectName(String name) {
        try {
            return sysRoleDao.selectName(name);
        } catch (SQLException e) {
            throw new RuntimeException(e);
        }
    }

    @Override
    public int addSysRole(SysRole sysRole) {
        try {
            return sysRoleDao.addSysRole(sysRole);
        } catch (SQLException e) {
            throw new RuntimeException(e);
        }
    }

    @Override
    public int updateSysRole(SysRole sysRole) {
        try {
            return sysRoleDao.updateSysRole(sysRole);
        } catch (SQLException e) {
            throw new RuntimeException(e);
        }
    }

    @Override
    public int deleteSysRole(String id) {
        try {
            return sysRoleDao.deleteSysRole(id);
        } catch (SQLException e) {
            throw new RuntimeException(e);
        }
    }
}
